package com.gitee.hljdrl.utils.collection;

import java.util.Collection;
import java.util.Map;
import java.util.Stack;
import java.util.Vector;

/**
 * Collection判断工具
 */
public class CollectionUtil {


    /**
     * List 、ArrayList、Map、Stack 判断是否无效
     *
     * @param collection
     */
    public static boolean isEmpty(Collection<?> collection) {
        if (collection == null || collection.isEmpty()) {
            return true;
        }
        return false;
    }

    public static boolean isEmpty(Map<?, ?> collection) {
        if (collection == null || collection.isEmpty()) {
            return true;
        }
        return false;
    }

    /**
     * List 、ArrayList、Map、Stack 判断是否有效
     *
     * @param collection
     */
    public static boolean isEnable(Collection<?> collection) {
        if (collection != null && !collection.isEmpty()) {
            return true;
        }
        return false;
    }

    public static boolean isEnable(Object[] array) {
        if (array != null && array.length > 0) {
            return true;
        }
        return false;
    }


}
